#include <cstddef>
#include <string>

#include <memchart.hpp>

using namespace std;
using memchart::update;

int a;

struct Base1
{
	int  i;

	Base1 ()
		: i(123)
	{ }


	MC_BEGIN(Base1)
		MC_MEMBER(i)
	MC_END
};

struct Base2
{
	char c;

	Base2 ()
		: c('A')
	{ }


	MC_BEGIN(Base2)
		MC_MEMBER(c)
	MC_END
};

struct Base3 : Base2
{
	char  c;

	Base3 ()
		: c('B')
	{ }


	MC_BEGIN(Base3)
		MC_BASE(Base2)
		MC_MEMBER(c)
	MC_END
};

struct Inner
{
	const int  ci;
	string     s;

	Inner ()
		: ci(256), s("hello")
	{ }


	MC_BEGIN(Inner)
		MC_MEMBER(ci)
		MC_MEMBER(s)
	MC_END
};

MC_SHOW_MEMBERS(Inner)

struct A : Base1, Base3
{
	void  *p;
	int    arr[3];
	void  *v[2];
	Inner  in;

	A ()
		: p(&a)
	{
		arr[0] = 1; arr[1] = 2; arr[2] = 3;
		v[0] = NULL; v[1] = &a;
	}


	MC_BEGIN(A)
		MC_BASE(Base1)
		MC_BASE(Base3)
		MC_MEMBER(p)
		MC_MEMBER(arr)
		MC_MEMBER(v)
		MC_MEMBER(in)
	MC_END
};

int main ()
{
	A *a = new A;

	update();

	delete a;
}
